<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "/xadmin/inc/common.html">
<script type="text/JavaScript">
	function saveUser(){
		var url = '${request.contextPath}/xadmin/system/usermanage-updateuser?userid=${obj.userid}';
		$('form').form('submit',{  
		    url:url,
		    onSubmit:function(param){
			    if($('#userpassword').val()!=$('#passwd2').val()){
			    	window.top.$.messager.alert('提示','两次输入的密码不一致，请重新输入！');
			    	$('#userpassword').val('');
			    	$('#passwd2').val('');
			    	return false;
			    }
			    param.userbirthday = $('#userbirthday').datebox('getValue');
			    param.usersex = $('#usersex').combobox('getValue');
			    param.depid = $('#depid').combotree('getValue');
				return $(this).form('validate');
		    },  
		    success:function(data){  
				$.messager.alert('提示',data,'info',function(){
			    	window.location.reload(true);
				});
		    }  
		});
	}
	function resetForm(){
		$('#username').val('${obj.username!}');
		$('#userpassword').val('${obj.userpassword!}');
		$('#userquestion').val('${obj.userquestion!}');
		$('#useranswer').val('${obj.useranswer!}');
		$('#fullname').val('${obj.fullname!}');
		$('#usersex').combobox('setValue','${obj.usersex!}');
		$('#userbirthday').datebox('setValue','${obj.userbirthday!}');
		$('#tel').val('${obj.tel!}');
		$('#email').val('${obj.email!}');
		$('#content').val('${obj.content!}');
		$('#depid').combobox('setValue','${obj.depid!}');
	}
	function onload(){
		$('#usersex').combobox('setValue','${obj.usersex!}');
		$('#depid').combotree('setValue','${obj.depid!}');
		$('#userbirthday').datebox('setValue','${obj.userbirthday!}');
	}
</script>

</head>
<body onload="onload();">
<div align="center" class="easyui-panel" data-options='fit:true,border:false'>
<table align=center border="0" width="90%" cellspacing="0" cellpadding="0" class="table_all">
<form method="post" name="flmxForm" id="flmxForm">
<tr><td height="35" class="td_title" colspan="4" style="padding-left:7px;">修改个人信息</td></tr>
        <input type="hidden" id="username" name="username" value="${obj.username!}">
      <tr>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">密&nbsp;&nbsp;&nbsp;码：<font color=red>*</font></span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-validatebox" required="true" id="userpassword" type="password" name="userpassword" maxlength="15" style="width:200px;" value="${obj.userpassword!}">
          </div></td>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">验证密码：<font color=red>*</font></span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-validatebox" required="true" id="passwd2" type="password" name="passwd2" maxlength="15" style="width:200px;" value="${obj.userpassword!}">
          </div></td>
      </tr>
      <tr>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">提示问题：</span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-validatebox" name="userquestion" type="text" maxlength="30" value="${obj.userquestion!}" style="width:200px;" >
          </div></td>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">问题答案：</span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-validatebox" name="useranswer" type="text" maxlength="30" value="${obj.useranswer!}" style="width:200px;" >
          </div></td>
      </tr>
      <tr>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">真实姓名：</span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-validatebox" type="text" id="fullname" name="fullname" maxlength="10" style="width:200px;" value="${obj.fullname!}">
          </div></td>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">工作单位：</span></td>
        <td height="35" class="td_table_2">&nbsp;
        	<input id="depid" class="easyui-combotree" name="depid" id="depid" style="width:200px;" data-options="url:'deptmanage-listdeptfortree'" />
      </tr>
      </tr>
      <tr>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">性别：</span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<select size="1" name="usersex" id="usersex"  class="easyui-combobox" panelHeight="80">
				<option <#if obj.usersex=='1'>selected</#if> value="1">先生</option>
				<option <#if obj.usersex=='2'>selected</#if> value="2">女士</option>
				<option <#if obj.usersex=='0'>selected</#if> value="0">保密</option>
			</select>
          </div></td>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">生日：</span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-datebox" id="userbirthday" name="userbirthday" style="width:200px;" panelWidth="200">
          </div></td>
      </tr>
      <tr>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">联系电话：</span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-validatebox" type="text"   id="tel" name="tel" maxlength="100" style="width:200px;" value="${obj.tel!}">
          </div></td>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">邮箱：</span></td>
        <td height="35" class="td_table_2"><div align="left">&nbsp;
        	<input class="easyui-validatebox" type="text" validType="email"   id="useremail" name="useremail" maxlength="100" style="width:200px;" value="${obj.useremail!}">
          </div></td>
      </tr>
      <tr>
        <td height="35" align="right" class="td_table_1"><span class="smallFont">自我介绍：</span></td>
        <td height="35" colspan="3" class="td_table_2"><div align="left">&nbsp;
        	<textarea rows="10" id="content" name="content" cols="60" style="width:95%;" >${obj.content!}</textarea>
          </div></td>
      </tr>
      <tr> 
		<td colspan="4" class="td_table_2">
			<div align="center">
			<input type="button" class="button_70px" onclick="saveUser();" value="保存">  
	        <input type="button" class="button_70px" onclick="resetForm();" value="重置"> 
			</div>	</td>
	  </tr>
	  </form>
  </table><br>
  </div>
</body>
</html>